<template>
  <div>
    <img :src="showimg" alt="" @load="imageload" @click="clickgoods" />
    <span>{{ goods.chinese }}</span>
  </div>
</template>

<script>
export default {
  props: {
    goods: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  computed: {
    showimg() {
      return this.goods.image || this.goods.show.img;
    },
  },
  methods: {
    imageload() {
      // console.log("图片加载完成");
      this.$bus.$emit("loadimage");
    },
    clickgoods() {
      this.$router.push("detail/" + this.goods.iid);
      console.log(this.goods.iid);
    },
  },
};
</script>
<style scoped>
img {
  border-radius: 4px;
}
</style>
